<template>
  <div>
    <div class="video-preview" v-if="showMaskLayerSwitches">
      <div class="close" @click="closeMaskLayer">
        <span class="el-icon-close spanColor"></span>
      </div>
      <div class="videoFather">
        <video controls>
          <source :src="videoURL" type="video/mp4" width="400" />
        </video>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: ['showMaskLayerSwitches', 'videoURL'],

  methods: {
    closeMaskLayer () {
      this.$emit('click')
    }
  }
}
</script>

<style scoped>
.video-preview {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  overflow: hidden;
  z-index: 9997;
}
.close {
  width: 50px;
  height: 50px;
  position: absolute;
  top: 30px;
  left: 50%;
  -webkit-transform: translate(-50%);
  transform: translate(-50%);
  background: rgba(0, 0, 0, 0.4);
  -webkit-box-shadow: 0 0 5px rgb(0 0 0 / 40%);
  box-shadow: 0 0 5px rgb(0 0 0 / 40%);
  border-radius: 50%;
  text-align: center;
  line-height: 50px;
  color: #fff;
  font-size: 20px;
}
.videoFather {
  position: absolute;
  top: 100px;
  left: 50%;
  transform: translate(-50%);
}
video {
  width: 800px;
}
</style>
